<?php

namespace app\admin\validate;

use think\Validate;

class SystemConfig extends Validate
{
    protected $rule = [
        'commission_rate' => 'require|checkVal',
        'earnest_rate' => 'require|checkVal',
    ];

    protected $message = [
        'commission_rate' => '佣金比例不能为空',
        'earnest_rate' => '保证金比例不能为空',
    ];
    protected function checkVal($value){
        if ($value<0||$value>100){
            return '比例值必须在0-100之间';
        }
        return true;
    }
}
